/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.net.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author MILAN
 */
public class Hilo extends Thread{
    Socket socket1;
    DataOutputStream dOut;
    DataInputStream dIn;

    public Hilo(Socket socket1) {
        this.socket1 = socket1;
        try {
            dOut = new DataOutputStream(this.socket1.getOutputStream());
            dIn = new DataInputStream(this.socket1.getInputStream());
        } catch (IOException ex) {
            Logger.getLogger(Hilo.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void run() {
        try {
            dOut.writeUTF("Hola Cliente");
            System.out.println(dIn.readUTF());
        } catch (IOException ex) {
            Logger.getLogger(Hilo.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}
